exports.cors = (request, response) => {
    // 处理跨域
    response.setHeader('Access-Control-Allow-Origin', '*');
    response.setHeader(
        'Access-Control-Allow-Headers',
        'x-requested-with,Authorization,token,Content-Type'
    );
    response.setHeader('Access-Control-Allow-Methods', 'PUT,POST,GET,DELETE,OPTIONS');
    // 对跨域下的多发的 OPTIONS 请求进行处理
    if (request.method === 'OPTIONS') {
        // CORS
        response.statusCode = 200;
        response.end();
    }
};